package com.lsm.visitor;

import java.util.ArrayList;
import java.util.List;

public class Family extends Acceptor {

	private String name;

	private List<Person> persons = new ArrayList<Person>();

	public Family(String name) {
		this.name = name;
	}
	
	public void addPerson(Person person) {
		persons.add(person);
	}

	public String getName() {
		return name;
	}

	public void acceptor(Visitor visitor) {
		visitor.visitorFamily(this);
		for (Person person : persons) {
			person.acceptor(visitor);
		}
	}

}
